<?php
session_start();
include "conn/conn.php";
include "inc/func.php";
$sqlstr = "select * from admin where manager = '".$_POST[username]."' and mana_pwd = '".$_POST[pwd]."'";
	$result = mysql_query($sqlstr,$conn);
	$record = mysql_fetch_row($result);
	if($record != "")
	{
		$_SESSION["m_id"] = $record[0];				
		$_SESSION["controller"] = $_POST[username];		
		w_log($_POST[action],$_SESSION[controller]);	
		echo "<script>alert('LOGIN SUCCESS !');location='admin_main.php';</script>";
	}
	else
		echo "<script>alert('WRONG USERNAME OR PASSWORD !');history.go(-1);</script>";
?>